/*
 * base.h
 *
 *  Created on: 2009-5-8
 *      Author: thh
 */

#ifndef BASE_H_20090507
#define BASE_H_20090507

#include <Python.h>
#include <openssl/rsa.h>
#include <openssl/engine.h>

#define MODULE_NAME "pyCryptic"

typedef struct PyRSA{
	PyObject_HEAD
	RSA *rsa;
} PyRSA;
extern PyTypeObject PyRSA_Type;

typedef struct PyPem{
	PyObject_HEAD
}PyPem;
extern PyTypeObject PyPem_Type;

extern PyObject *PyExc_OpenSSLError;

int PyRSA_Init(PyRSA *self,PyObject *args);
void PyRSA_Del(PyRSA *self);
PyObject *PyRSA_Str(PyRSA *self);
PyObject *PyRSA_Size(PyRSA *self);
PyObject *PyRSA_Check(PyRSA *self);

PyObject *PyRSA_public_encrypt(PyRSA *self,PyObject *args);
PyObject *PyRSA_private_decrypt(PyRSA *self,PyObject *args);
PyObject *PyRSA_private_encrypt(PyRSA *self,PyObject *args);
PyObject *PyRSA_public_decrypt(PyRSA *self,PyObject *args);

PyObject *PyRSA_sign(PyRSA *self,PyObject *args);
PyObject *PyRSA_verify(PyRSA *self,PyObject *args);

PyObject *PyPem_RSA_ReadPrivateKey(PyObject *self,PyObject *args);
void PyErr_OpenSSLError();

#endif /* BASE_H_20090507 */
